/*    */ package com.zimbra.cs.script;
/*    */ 
/*    */ import com.zimbra.common.localconfig.KnownKey;
/*    */ import com.zimbra.common.localconfig.LC;
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.SoapTransport;
/*    */ import com.zimbra.common.util.CliUtil;
/*    */ import com.zimbra.cs.account.Provisioning;
/*    */ import com.zimbra.cs.account.soap.SoapProvisioning;
/*    */ import com.zimbra.cs.util.BuildInfo;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class ScriptUtil
/*    */ {
/*    */   public static void initProvisioning()
/*    */     throws ServiceException
/*    */   {
/* 36 */     initProvisioning(null);
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */   public static void initProvisioning(ProvisioningOptions options)
/*    */     throws ServiceException
/*    */   {
/* 49 */     if (options == null) {
/* 50 */       options = new ProvisioningOptions();
/*    */     }
/* 52 */     CliUtil.toolSetup();
/* 53 */     SoapProvisioning sp = new SoapProvisioning();
/*    */     
/* 55 */     String userAgent = options.getUserAgent();
/* 56 */     String userAgentVersion = options.getUserAgentVersion();
/* 57 */     if (userAgent == null) {
/* 58 */       userAgent = "Zimbra Scripting";
/* 59 */       userAgentVersion = BuildInfo.VERSION;
/*    */     }
/* 61 */     SoapTransport.setDefaultUserAgent(userAgent, userAgentVersion);
/*    */     
/* 63 */     String uri = options.getSoapURI();
/* 64 */     if (uri == null) {
/* 65 */       uri = LC.zimbra_admin_service_scheme.value() + "localhost:7071" + "/service/admin/soap/";
/*    */     }
/* 67 */     sp.soapSetURI(uri);
/*    */     
/* 69 */     String user = options.getUsername();
/* 70 */     if (user == null) {
/* 71 */       user = LC.zimbra_ldap_user.value();
/*    */     }
/*    */     
/* 74 */     String password = options.getPassword();
/* 75 */     if (password == null) {
/* 76 */       password = LC.zimbra_ldap_password.value();
/*    */     }
/* 78 */     sp.soapAdminAuthenticate(user, password);
/*    */     
/* 80 */     Provisioning.setInstance(sp);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/script/ScriptUtil.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */